using System;
using System.Collections.Generic;
using System.Text;
using WCSFContrib.ECommerceCatalog.BusinessEntities;
using WCSFContrib.ECommerceCatalog.Product.Services;
using WCSFContrib.ECommerceCatalog.Product.Interfaces.Services;

namespace WCSFContrib.ECommerceCatalog.Product.Tests.Mocks
{
    public class MockItemService : IItemsService
    {
        public bool GetItemByIdCalled = false;
        public bool SearchItemsCalled = false;
        private Item _item = null;
        private ICollection<Item> _itemsCollection = null;

        public MockItemService()
        {
            _itemsCollection = new List<Item>();
            _item = new Item();

            _itemsCollection.Add(_item);
        }

        #region IItemsService Members

        public ICollection<Item> AllItems
        {
            get { throw new Exception("The method or operation is not implemented."); }
        }

        public Item GetItemById(int itemId)
        {
            GetItemByIdCalled = true;
            return _item;
        }

        public ICollection<Item> GetItemsByCategory(int categoryId)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public void UpdateItem(Item item)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public ICollection<Item> SearchItems(string searchText)
        {
            SearchItemsCalled = true;
            return _itemsCollection;
        }

        public ICollection<Item> SearchItems(string searchText, string categoryId)
        {
            SearchItemsCalled = true;
            return _itemsCollection;
        }

        #endregion
    }
}
